import requests from '@/plugins/requests'
// 搜索售货机(售货机列表)
export const searchEquipmentAPI = (params) => requests({
  url: '/api/vm-service/vm/search',
  params
})
// 售货机类型列表(搜索)
export const vmTypeAPI = (params) => requests({
  url: '/api/vm-service/vmType/search',
  params
})
// 新增售货机
export const addEquipmentAPI = (data) => requests({
  url: '/api/vm-service/vm',
  method: 'POST',
  data
})
// 获取策略列表
export const getPolicyAPI = (params) => requests({
  url: '/api/vm-service/policy',
  params
})
// 应用策略
export const applyPolicyAPI = (data) => requests({
  url: '/api/vm-service/vm/applyPolicy',
  method: 'PUT',
  data
})
// 查询售货机策略
export const policySearchAPI = (innerCode) => requests({
  url: `/api/vm-service/policy/vmPolicy/${innerCode}`
})
// 取消策略
export const cancelPolicyAPI = (innerCode, policyId) => requests({
  url: `/api/vm-service/vm/cancelPolicy/${innerCode}/${policyId}`,
  method: 'PUT'
})
// 修改售货机点位
export const repairPolicyNodeAPI = (id, nodeId) => requests({
  url: `/api/vm-service/vm/${id}/${nodeId}`,
  method: 'PUT'
})
// 售货机类型详情
export const equipmentTypeAPI = (vmType) => requests({
  url: `/api/vm-service/vmType/${vmType}`
})
// 获取售货机货道详情
export const goodsChannelListAPI = (innerCode) => requests({
  url: `/api/vm-service/channel/channelList/${innerCode}`
})
// 智能排货推荐地区
export const getArrangeAPI = (id) => requests({
  url: `/api/vm-service/businessType/name/${id}`
})
export const businessTopAPI = (id) => requests({
  url: `api/vm-service/sku/businessTop10/${id}`
})
// 商品搜索
export const searchGoodsAPI = (params) => requests({
  url: '/api/vm-service/sku/search',
  params
})
// 货道配置 /api/vm-service/channel/channelConfig
export const channelConfigAPI = (data) => requests({
  url: '/api/vm-service/channel/channelConfig',
  method: 'PUT',
  data
})
// 新增售货机类型
export const addEquipmentTypeAPI = (data) => requests({
  url: '/api/vm-service/vmType',
  method: 'POST',
  data
})
// 修改售货机
export const repairEquipmentAPI = (typeId, data) => requests({
  url: `/api/vm-service/vmType/${typeId}`,
  method: 'PUT',
  data
})
